﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Application.Entity;
/// <summary>
/// 库存管理实体
/// </summary>
[SugarTable("inventorymanagement", TableDescription = "库存管理表")]
// 唯一索引
[SugarIndex("uk_{table}", "WarehousCode", OrderByType.Asc, "WarehousePositionCode", OrderByType.Asc, "Palcode", OrderByType.Asc, true)]
// 查询索引
[SugarIndex("index_{table}_name", "MaterialName", OrderByType.Asc, "MaterialCode", OrderByType.Asc, false)]
public class InventoryManagementEntity : EntityBaseData
{
    /// <summary>
    /// 当前仓库
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "当前仓库编码", Length = 32)]
    public string? WarehousCode { get; set; }

    /// <summary>
    /// 当前库位
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "当前库位", Length = 32)]
    public string WarehousePositionCode { get; set; }

    /// <summary>
    /// 物料编码
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "物料编码", Length = 50, IsOnlyIgnoreUpdate = true)]
    public string MaterialCode { get; set; }

    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "物料名称", Length = 50)]
    public string MaterialName { get; set; }

    /// <summary>  
    /// 批次  
    /// </summary>  
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "批次", Length = 50, IsNullable = true)]
    public string Batch { get; set; }

    /// <summary>
    /// 入-参考号
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "参考号", Length = 32 ,IsNullable = true)]
    public string Reference { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    [SugarColumn(ColumnDescription = "数量", IsNullable = true)]
    public int Number { get; set; }

    /// <summary>
    /// 箱条码
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "箱条码", Length = 32, IsNullable = true)]
    public string BoxCode { get; set; }

    /// <summary>
    /// 母托盘
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "母托盘", Length = 32)]
    public string Palcode { get; set; }

    /// <summary>
    /// 子托盘
    /// </summary>
    [MaxLength(32)]
    [SugarColumn(ColumnDescription = "子托盘", Length = 32, IsNullable = true)]
    public string Subtray { get; set; }
    /// <summary>
    /// 收货日期
    /// </summary>
    
    [SugarColumn(ColumnDescription = "收货日期")]
    public DateTime? DateofReceipt { get; set; }

    /// <summary>
    /// 库存状态
    /// </summary>
    [SugarColumn(ColumnDescription = "库存状态")]
    public InventoryStatus Status { get; set; }

    /// <summary>
    /// 是否有货物默认0：没有，1：有
    /// </summary>
    [SugarColumn(ColumnDescription = "是否有货")]
    public WStatusEnum Available { get; set; }
}


